-
-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chore: Add witness hint for module_missing
lint
#1203
Chore: Add witness hint for module_missing
lint
#1203
Conversation
module_missing
lint and update snapshotmodule_missing
lint
module_missing
lintmodule_missing
lint
I'm not sure I understand the edge case here. Could you tell me more about it? |
Sure, here is an edge case example: Let's say this is our old version code: pub mod bb {
pub mod will_change_to_fn {}
} and it is changed to: pub mod bb {
pub fn will_change_to_fn() {}
} In the above case, the witness hint One way I can think of to resolve this edge case (how to distinguish However, there is no limitation of levels for Rust nested modules, implementing such an idea probably requires recursive calls. Also, there are edge cases for this approach as well ... assuming all modules have public elements under it (i.e. a function), then Hope that makes my statement more clear, please let me know you thoughts about it. |
Ah, I see. How about a different option then: There's a similar edge case here: enums allow glob imports of all their variants. But clippy by default will complain about both uppercase-named modules and lowercase-named enums, so in practice this edge case will be much much more rare. I think that's probably an acceptable tradeoff for a witness hint. What do you think? |
Sounds good to me, I'll include the edge cases description as comments as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't see the comments about the edge case you mentioned you might add, but this looks good already so we can add & merge those later if you'd like.
Add a witness hint for
module_missing
, addressing #937This witness hint is valid as
use removed_mod::func;
does not compile in Rust.However, there is an edge cases where
use removed_mod::inner_mod
exists in the old version code, but it was replaced byuse removed_mod::inner_function (but the function name is same as the previously removed inner_mod)
, then this witness hint may be a True Negative witness hint.